﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>添加新会员</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/static/admin/style/adminStyle.css" rel="stylesheet" type="text/css" />
</head>
<body>
 <div class="wrap">
  <div class="page-title">
    <span class="modular fl"><i class="add_user"></i><em>添加新会员</em></span>
  </div>
  <form>
  <table class="list-style">
   <tr>
    <td style="width:15%;text-align:right;">用户昵称：</td>
    <td><input type="text" class="textBox length-middle" id="nick_name"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">设置密码：</td>
    <td><input type="password" class="textBox length-middle" id="password"/></td>
   </tr>
   <tr>
    <td style="text-align:right;">手机号码：</td>
    <td><input type="text" class="textBox length-middle" id="phone"/></td>
   </tr>
   <tr>
    <td style="text-align:right;"></td>
    <td><input type="submit" class="tdBtn" value="添加新用户"/></td>
   </tr>
  </table>
  </form>
 </div>

<div>
 <script src="/static/index/js/jquery-1.12.4.min.js"></script>
 <script>
  $(".tdBtn").click(function(){
    console.log("asfdasfd");
    var nick_name = $.trim($('#nick_name').val());
    var password = $.trim($('#password').val());
    var phone = $.trim($('#phone').val());
    $.ajax({
        url:"/add_user",
        type:"post",
        data:{"nick_name":nick_name,"password":password,"phone":phone,},
        success:function(data){
            if(data.code==0){
                location.href = "/user_list"
            }else{
                alert(data.msg)
            }
        },
    })

});
 </script>
</div>
</body>
</html>